package com.example.myapplication

import com.example.myapplication.clean_craftsmanship.IntSort
import org.junit.Assert.*
import org.junit.Test

/**
 *Create by Fanketly on 2022/9/2
 *Gitee:https://gitee.com/fanketly
 *desc:
 */
class SortTest {
    private val intSort = IntSort()

    @Test
    fun createIntSort() {
        val intSort = IntSort()
    }

    @Test
    fun sortOne() {
        assertEquals(listOf(1), intSort.sort(mutableListOf(1)))
    }

    @Test
    fun sortTwo() {
        assertEquals(listOf(1,2), intSort.sort(mutableListOf(2,1)))
        assertEquals(listOf(1,2), intSort.sort(mutableListOf(1,2)))
    }

    @Test
    fun sortFour() {
        assertEquals(listOf(1,2,3,4), intSort.sort(mutableListOf(4,3,2,1)))
        assertEquals(listOf(1,2,3,4), intSort.sort(mutableListOf(3,4,2,1)))
        assertEquals(listOf(1,2,3,4), intSort.sort(mutableListOf(3,2,4,1)))
    }

    @Test
    fun sortMany() {
        println(intSort.sort(mutableListOf(12,23,2421,432132,312,21213,21,12,23)))
    }
}